﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JESAI.Platform.Domain.DynamicApi.Entities
{
    [SugarTable("tb_dynamic_api")]
    public class DynamicApiEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
        public string Id { set; get; }

        /// <summary>
        /// API名称
        /// </summary>
        public string ApiName { set; get; }

        /// <summary>
        /// 代码codeID
        /// </summary>
        public string CodeTreeId { set; get; }

        /// <summary>
        /// Http类型
        /// </summary>
        public HttpType HttpType { set; get; }

        /// <summary>
        /// 修改人
        /// </summary>
        public long Uid { set; get; }

        /// <summary>
        /// 创建人
        /// </summary>
        public long Cid { set; get; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { set; get; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime UpdateTime { set; get; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public bool IsValid { get; set; }

        /// <summary>
        /// API描述
        /// </summary>
        public string Description { set; get; }

        /// <summary>
        /// API标识
        /// </summary>
        public string ApiSign { set; get; }

        /// <summary>
        /// 入口函数
        /// </summary>
        public string EntryFunction { set; get; }

        /// <summary>
        /// 入口参数
        /// </summary>
        public string CodeFileName { set; get; }
    }
}


public enum HttpType
{
    //http类型：1.Post 2.Get 3.Put 4.Delete 5.Patch 6.Options 7.Head 
    Post = 1,
    Get = 2,
    Put = 3,
    Delete = 4,
    Patch = 5,
    Options = 6,
    Head = 7
}